package com.googlecode.scenemaker3d.view
{
	import org.papervision3d.core.geom.Lines3D;
	import org.papervision3d.core.geom.renderables.Line3D;
	import org.papervision3d.core.geom.renderables.Vertex3D;
	import org.papervision3d.materials.special.LineMaterial;
	
	public class DrawLine extends Lines3D
	{
		private var l:Line3D;
		private var lm:LineMaterial;
		
		public function DrawLine(lm:LineMaterial, vt1:Vertex3D, vt2:Vertex3D)
		{
			super(lm);
			
			this.lm = lm;
			
			
			
			update(vt1, vt2);
			
		}
		public function update(vt1:Vertex3D, vt2:Vertex3D):void{
			if(l!=null){
				this.removeLine(l);
			}
			l = new Line3D((this as Lines3D), lm, 1, vt1, vt2);
			this.addLine(l);
		}

	}
}